define(function(require){
	var $ = require("jquery");
	var justep = require("$UI/system/lib/justep");

	var Model = function(){
		this.callParent();
	};
  Model.prototype.modelParamsReceive = function(event){
      var data=this.comp("zhuanjia");
       data.clear();
       data.loadData([this.params.rowdata]);
       data.first();
	};
	Model.prototype.button1Click = function(event){
	     var data=this.comp("zhuanjia").getLastRow().toJson();
	       this.close();
	  //    console.log(data)
	      var zid=data.uid.value;
	 //    console.log(zid)
	   // var title='测试数据';
	      
	      var content=$('.x-edit').val();
	    // console.log(content)
      $.ajax({
        type: "POST",
        url: window.yuming+'/newherdsmans/AppAddTask?login-token='+window.token,     
        async: false,
        cache: false,
        dataType: 'json',
		data:{ expertId:zid,content: content},
        success: function(datas){
                
           /*   localStorage.roomurl=datas.url+datas.roomid;
              
              localStorage.roomid=datas.id;
              
              win.open({
              
                  params:{
                  
                     rowdata:row.toJson()
                     
                   } 
                       
               });*/
            
               // alert(datas.roomid);
               //alert(datas.roomid)
              // location.href=datas.url+datas.roomid;
            },
        error: function(XMLHttpRequest){  
        }
    });
	};

	return Model;
});